-- UNITDEF -- BISHOP --
--------------------------------------------------------------------------------

local unitName = "bishop"

--------------------------------------------------------------------------------

local unitDef = {
  acceleration       = 1.5,
  brakeRate          = 1.5,
  buildCostMetal     = 10,
  canAttack          = true,
  canMove            = true,
  canstop            = 1,
  category           = [[PLAYER UNARMORED UNIT TARGET]],
  CloakCost = 40,   -- minus 20 is 20 sec cloack
	initcloaked = 0, 
	minCloakDistance    = 150,
	init_cloaked = false, 
	decloakOnFire  = false,
  collisionvolumetest = 1,
    customParams        = {
   	toggle1 = 2,
	toggle1on = [[Secondary]],
	toggle1off = [[Primary]],
	toggle1tooltip = [[Switch between weapons]],
    helptext       = [[The Bishop specializes in Long Range Attacks. It has a cloaking ability and an Auto Cannon as a secondary weapon]],
     },
  corpse              = [[DEAD]],
  description        = [[Sniper]],
  energyMake         = 20,  --20 sec to recharge
  energyStorage      = 400,
  explodeAs          = [[Death]],
  footprintX         = 2,
  footprintZ         = 2,
  iconType           = [[armor]],
  idleAutoHeal       = 0,
  idleTime           = 30,
  levelGround        = false,
  maxDamage          = 600,
  maxthisunit        = 1,
  maxVelocity        = 2, -- walk was 3
  metalMake          = 0,
  metalStorage       = 0,
  movementClass      = [[ENGINE]],
  name               = [[Kyu Jutsu]], -- J:KyuJutsu =art of bow   K:Gungsul =same
  noChaseCategory    = [[NOTARGET AIR]], 
 objectName         = [[bishop.s3o]],
  radarDistance      = 0,
  reclaimable        = false,
  seismicSignature   = 1,
  selfDestructAs     = [[Death]],
  selfDestructCountdown = 1,
  showNanoFrame      = false,
  showPlayerName     = true,
  sightDistance      = 900, --- pawn 800 player 900?
  smoothAnim         = true,
  turnInPlace	    = 1,  --need for strafing
  turnRate           = 1500,
  unitname           = [[bishop]],
  upright            = true,
  sfxtypes = {
    explosiongenerators = {
	[[custom:flashmuzzle1]],
	[[custom:burning]],
    [[custom:JumpImpact]],
    },
  },
  -- sounds = {
    -- arrived = {
      -- [[commandgiven]],
    -- },
    -- ok = {
      -- [[commandgiven]],
    -- },
    -- select = {
      -- [[select]],
    -- },
  -- },
  weapons = {
    [1]  = {
      def                = [[gunb1]],
	 --- badtargetcategory  = [[NOTARGET]], ---players can shoot at whaterver they want
      onlyTargetCategory = [[TARGET]],
      mainDir            = [[0 0 1]], --- wont read quotes
      maxAngleDif        = 170,
    },
    [2]  = {
      def                = [[smallb1]],
	  ---badtargetcategory  = [[NOTARGET]],
      onlyTargetCategory = [[TARGET]],
	  mainDir            = [[0 0 1]], --- wont read quotes
      maxAngleDif        = 170,
    },
	[3]  = {
      def                = [[Stomp]],
	  badtargetcategory  = [[PLAYER BASE]],		 
      onlyTargetCategory = [[SMALL]],
    },
  },
}


--------------------------------------------------------------------------------

local weaponDefs = {
  gunb1 = {
    avoidFriendly      = false,
	CanAttackGround = false,
    collideFriendly    = false,
    craterBoost        = 0,
    craterMult         = 0,
    duration           = .03,
    explosionGenerator = [[custom:none]],
    id                 = 1,
    impactonly         = 1,
    impulseBoost       = 0,
    impulseFactor      = 0,
    interceptedByShieldType = 0,
    name               = [[Sniper Rifle]],
    range              = 1200,
    reloadtime         = 6, --- was 3 but double damage
    rgbColor           = [[.2 1 1]],
    soundStart         = [[bishopshot]],
    sprayAngle         = 400,
    thickness          = 2,
    tolerance          = 400,
    turret             = true,
    weaponType         = [[LaserCannon]],
    weaponVelocity     = 1200,
    damage = {
      default            = 320,
    },
  },
  
  smallb1 = {
    avoidFriendly      = false,
    burst              = 2,
    burstrate          = 1.2,
	CanAttackGround = false,
    collideFriendly    = false,
    craterBoost        = 0,
    craterMult         = 0,
    duration           = .03,
    explosionGenerator = [[custom:none]],
    id                 = 1,
    impactonly         = 1,
    impulseBoost       = 0,
    impulseFactor      = 0,
    interceptedByShieldType = 0,
    name               = [[Heavy Cannon]],
    range              = 150,
    reloadtime         = 3,
    rgbColor           = [[1 1 .2]],
    soundStart         = [[cannon]],
    sprayAngle         = 600,
    thickness          = 3,
    tolerance          = 400,
    turret             = true,
    weaponType         = [[LaserCannon]],
    weaponVelocity     = 500,
    damage = {
      default            = 80,
			},
  },
  Stomp       = {
      name                    = [[Stomp]],
      areaOfEffect            = 84,
      collideFriendly         = false,
      craterBoost             = 1,
      craterMult              = 1,

      damage                  = {
        default = 0,
		small = 50,
      },

      edgeEffectiveness       = 0.5,
      explosionGenerator      = [[custom:NONE]],
      impulseBoost            = 2, --might have to adjust
      impulseFactor           = 0.2,
      intensity               = 1,
      interceptedByShieldType = 1,
      lineOfSight             = false,
      noSelfDamage            = true,
      range                   = 30,
      reloadtime              = 1,
      renderType              = 4,
      rgbColor                = [[1 1 1]],
      thickness               = 1,
      tolerance               = 100,
      turret                  = true,
      weaponType              = [[Cannon]],
      weaponVelocity          = 0.8,
    },
}
unitDef.weaponDefs = weaponDefs

local featureDefs = {
    DEAD  = {
      description      = [[Wreckage - Bishop]],
      blocking         = true,
      category         = [[corpses]],
      damage           = 3000,
      energy           = 0,
	  featureDead      = [[HEAP]],
      featurereclamate = [[SMUDGE01]],
      footprintX       = 3,
      footprintZ       = 4,
      height           = [[20]],
      hitdensity       = [[100]],
      metal            = 0,
      object           = [[bishop_dead.s3o]],
      reclaimable      = false,
      reclaimTime      = 0,
      world            = [[All Worlds]],
    },
	
	 HEAP  = {
      description      = [[Debris - Engine]],
      blocking         = false,
      category         = [[heaps]],
      damage           = 1000,
      energy           = 0,
      featurereclamate = [[SMUDGE01]],
      footprintX       = 3,
      footprintZ       = 4,
      height           = [[4]],
      hitdensity       = [[100]],
      metal            = 0,
      object           = [[engine_heap.s3o]],
      reclaimable      = false,
      reclaimTime      = 0,
      seqnamereclamate = [[TREE1RECLAMATE]],
      world            = [[All Worlds]],
    },
  }
  unitDef.featureDefs = featureDefs
--------------------------------------------------------------------------------

return lowerkeys({ [unitName] = unitDef })

--------------------------------------------------------------------------------
